<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="View/bt3/css/bootstrap.min.css" />
	</head>
	<body>
		<div class="container">
			<div class="alert alert-success" role="alert" style="margin-top: 20px;">PHP留言板</div>
			<table class="table table-hover">
				<tr>
					<td width="50">ID</td>
					<td>内容</td>
					<td width="100">昵称</td>
					<td width="150">操作</td>
				</tr>
				
				<?php foreach($data as $k => $v): ?>
					<tr>
						<td><?php echo $k ?></td>
						<td><?php echo $v['content'] ?></td>
						<td><?php echo $v['nickname'] ?></td>
						<td>
							<a href="edit.php?id=<?php echo $k ?>" class="btn btn-info  btn-sm">编辑</a>
							<a href="javascript:if(confirm('确认删除吗？')) location.href='del.php?id=<?php echo $k ?>'" class="btn btn-danger btn-sm">删除</a>
						</td>
					</tr>
				<?php endforeach ?>
			</table>
			<form method="post" action="">
				<div class="form-group">
					<input type="text" class="form-control" id="exampleInputEmail1" placeholder="请输入您的昵称" required="" maxlength="10" name="nickname">
				</div>
				<div class="form-group">
					<textarea name="content" rows="10" cols="" class="form-control" placeholder="请输入您的留言" required=""></textarea>
				</div>
				<button type="submit" class="btn btn-warning btn-block">留言</button>
			</form>
		</div>
	</body>
</html>